﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Administrator/MasterPage.master" AutoEventWireup="false" CodeFile="MPREFIX.aspx.vb" Inherits="Administrator_MPREFIX" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width:100%;">
                <tr>
                    <td align="right" width="150">
                        <asp:Label ID="lbCode" runat="server" CssClass="control"></asp:Label>
                    </td>
                    <td align="left" style="height: 26px">
                        <asp:TextBox ID="txtCode" runat="server" CssClass="control" 
                            Height="20px" Width="170px" MaxLength="3"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblNameTH" runat="server" CssClass="control"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNameTH" runat="server" CssClass="control" 
                            Height="20px" Width="315px" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblNameEN" runat="server" CssClass="control"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNameEN" runat="server" CssClass="control" Height="20px" 
                            Width="315px" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblNameSN" runat="server" CssClass="control"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNameSN" runat="server" CssClass="control" Height="20px" 
                            Width="315px" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblType" runat="server" CssClass="control"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlType" runat="server" CssClass="control" Width="160px" 
                            Height="25px">
                            <asp:ListItem>ทั้งหมด</asp:ListItem>
                            <asp:ListItem Value="1">บุคคลธรรมดา</asp:ListItem>
                            <asp:ListItem Value="2">นิติบุคคล</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;</td>
                    <td align="left" style="text-align: right">
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" 
                            Text="search" Width="80px" />
                        <asp:Button ID="btnAdd" runat="server" CssClass="control" Text="Add" 
                            Width="80px" />
                        <asp:Button ID="btnModify" runat="server" CssClass="control" Text="Modify" 
                            Width="80px" />
                        <asp:Button ID="btnDelete" runat="server" CssClass="control" Text="Delete" 
                            Width="80px" />
                        <asp:Button ID="btnClear" runat="server" CssClass="control" Text="Clear" 
                            Width="80px" />
                        <asp:Button ID="btnPrint" runat="server" CssClass="control" Text="Print" 
                            Width="80px" />
                    </td>
                </tr>
            </table>
            <div align="center">
                <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Size="30px" 
                        ForeColor="Red" Height="30px" style="text-align: center"></asp:Label>
                <asp:GridView ID="grdMaster" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" CellPadding="4" CssClass="control" 
                ForeColor="#333333" Width="100%" AllowPaging="True">
                    <FooterStyle BackColor="White" Font-Bold="True" ForeColor="#333333" />
                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                    <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                    <HeaderStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" 
                        SelectImageUrl="~/img/icon/select_icon.gif" ShowSelectButton="True">
                        <ItemStyle Width="3%" />
                        </asp:CommandField>
                        <asp:BoundField DataField="PREFIXCODE" HeaderText="รหัสคำนำหน้า" ReadOnly="True" 
                        SortExpression="PREFIXCODE">
                        <ItemStyle HorizontalAlign="Left" Width="150px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="PREFIXTH" HeaderText="ชื่อคำนำหน้า(ไทย)" ReadOnly="True" 
                        SortExpression="PREFIXTH">
                        <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="PREFIXEN" HeaderText="ชื่อคำนำหน้า(อังกฤษ)" 
                            SortExpression="PREFIXEN" />
                        <asp:BoundField DataField="PREFIXSN" HeaderText="ชื่อย่อ" 
                            SortExpression="PREFIXSN" />
                        <asp:TemplateField HeaderText="ประเภท" SortExpression="PREFIXTYPE">
                            <ItemTemplate>
                                <asp:Label ID="lblType" runat="server" 
                                    Text='<%# iif(Eval("PREFIXTYPE")=1,"บุคคลธรรมดา","นิติบุคคล") %>'></asp:Label>
                                <asp:HiddenField ID="hdfType" runat="server" 
                                    Value='<%# eval("PREFIXTYPE") %>' />
                            </ItemTemplate>
                            <ItemStyle Width="150px" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
            <div align="right">
                <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

